package main

import(
	"net/http"
	"gee"
)

func main() {
	r := gee.New()
	r.GET("/", func(ctx *gee.Context) {
		ctx.HTML(http.StatusOK, "<h1>Hello GEE</h1>")
	})

	r.GET("/hello", func(ctx *gee.Context) {
		ctx.String(http.StatusOK, "hello %s, you are at %s\n", ctx.Query("name"), ctx.Path)
	})

	r.POST("/login", func (c *gee.Context)  {
		c.JSON(http.StatusOK, gee.H{
			"username" : c.PostForm("username"),
			"password" : c.PostForm("password"),
		})
	})

	r.Run(":9999")
}
